<template>
	<div>{{ getFormatDate() }}</div>
</template>
<script lang="ts" setup>
import { format } from 'date-fns'
const props = defineProps({
	value: {
		type: [Number, String],
		default: ''
	},
	dateFormat: {
		type: String,
		default: 'p'
	}
})

const getFormatDate = () => {
	if (props.value) {
		return format(props.value, props.dateFormat)
	} else {
		return ''
	}
}
</script>
